package thread.threadexecutor;

import java.util.concurrent.*;

public class FutureDemo {

  public static void main(String[] args) {

    Thread thread = new Thread(new Runnable() {
      @Override
      public void run() {

      }
    });

    thread.start();

    Callable<String> objectCallable = new Callable<String>() {
      @Override
      public String call() throws Exception {
        return "DONE";
      }
    };

    ExecutorService executorService = Executors.newFixedThreadPool(1);

    Future<String> submit = executorService.submit(objectCallable);

    try {
      String s = submit.get();
      System.out.println(s);
    } catch (InterruptedException e) {
      e.printStackTrace();
    } catch (ExecutionException e) {
      e.printStackTrace();
    }


  }

}
